<?php
namespace Shopiuu\Model;

use Shopiuu\Http\RequestCore;

abstract class Model{

    public $accessToken = '';
    public $endpoint = '';
    
    public function __construct($accessToken, $endpoint)
    {
        $this->accessToken = $accessToken;
        $this->endpoint = $endpoint;
    }

    /**
     * Get RequestCore object
     * @return RequestCore
     */
    public function getRequest($api_path)
    {
        $url = $this->endpoint.$api_path;
        $request = new RequestCore($url);
        $request->add_header('Content-Type','application/json')->add_header('X-Shopiuu-Shop-Api-Access-token',$this->accessToken);
        return $request;
    }

}